package com.acme.task2;

public class GCTest {
	byte array[] = new byte[1024];

	public static void main(String[] args) {
		/*
		 * Program hasn't any problem with numberOfIterations
		 * in range [100..10000000]
		 * 
		 * 'finalize called' was displayed 
		 * with numberOfIterations = 1000000
		 * 
		 * java.lang.OutOfMemoryError exception occurs with 
		 * numberOfIterations = 10000000
		 */
		int numberOfIterations = 10000000;
		
		Foo[] fooArray = new Foo[numberOfIterations];
		for (int i = 0; i < numberOfIterations; i++) {
			fooArray[i] = new Foo();
		}
	}
}
